package mathgame.core;

public class Score {

	public int currentScore;
	public int combo;
	public int multiplier;
	
	public Score(){
		currentScore = 0;
        combo = 0;
        multiplier = 1;
    }
	
	public int getPoints(){
		return currentScore;
	}
	
	public void answerCorrect(){
		combo++;
		setMultiplier();
		currentScore += getMultiplier() * 50;
	}
	
	public void comboLost(){
		combo = 0;
		multiplier = 1;
	}

	public int getCombo() {
		return combo;
	}
	
	public void setMultiplier(){
		
		int k = getCombo();
		
		if (k==0){
			multiplier = 1;
		}
		else if (k>=3 && k<5) {
			multiplier = 2;
		}	
		else if (k>=5 && k<7) {
			multiplier = 3;
		}		
		else if (k>=7 && k<9) {
			multiplier = 4;
		}	
		else if (k>=9 && k<11) {
			multiplier = 5;
		}	
		else if (k>=11) {
			multiplier = 6;
		}	
	}
	
	public int getMultiplier(){
		return multiplier;
	}
}
